import React from 'react';
import { createRoot } from 'react-dom/client';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import 'antd/dist/reset.css'; // Ant Design 5.x 重置样式
import SettingsApp from './SettingsApp';
import ErrorBoundary from '../components/ErrorBoundary';
import { initGlobalErrorHandler } from '../utils/GlobalErrorHandler';
import '../styles/global.less';

// 初始化全局错误处理
initGlobalErrorHandler();

const container = document.getElementById('settings-root');
if (container) {
  const root = createRoot(container);
  root.render(
    <ErrorBoundary>
      <ConfigProvider locale={zhCN}>
        <SettingsApp />
      </ConfigProvider>
    </ErrorBoundary>
  );
}